package com.dong.demo1;

import com.dong.dao.UserDao;
import com.dong.entity.User;

import java.lang.reflect.Array;
import java.util.ArrayList;
import java.util.List;

public class UserTest {
    public static void main(String[] args) {
        UserDao userDao = new UserDao();
        userDao.addUser(new User(1,"小龙女","123","正常","test"));
        userDao.addUser(new User(2,"杨过","123","正常","test"));
        List<User> users = userDao.getAllUsers();
//        userDao.deleteUserById(1);
       User user1= new User(2,"杨1","123","正常","test");
        userDao.updateUser(user1);
        for (User user:users
             ) {
            System.out.println(user);

        }
    }
//        List<User> l = new ArrayList<>();
//        l.add(new User(1,"杨","123","正常","test"));
//        l.add(new User(2,"龙女","123","正常","test"));
//        System.out.println(l.indexOf(new User(2,"杨","123","正常","test")));
//
//    }
}
